//============================================================================
// Name        : ms003.cpp
// Author      : Tadas
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cmath>

#define PI 3.141592
#include "lib.h"

using namespace std;

double apat(double x){
	return -sqrt((PI/2)*(PI/2)-x*x);
}

double virs(double x){
	return sqrt((PI/2)*(PI/2)-x*x);
}

double f1(double x, double y){
	return sqrt(x*x + y*y)*cos(sqrt(x*x + y*y));
}

double f2(double x, double y){
	return cos(sqrt(x*x + y*y));
}


double f3(double x, double y){
	return 1.0;
}

double apat2(double x){
	return x;
}

double virs2(double x){
	return 2*x;
}



int main() {
	double a, b;
	
	a = -PI/2;
	b = PI/2;
	
	cout << "f1: " << sumTrapecX(f1, apat, virs, a, b) << endl;
	cout << "f2: " << sumTrapecX(f2, apat, virs, a, b) << endl;
	cout << "f3: " << sumTrapecX(f3, apat2, virs2, 1.0, 2.0) << endl;
	return 0;
}
